package com.guoranhao.business.enums;

/**
 * Description: 活动错误状态码枚举, 错误状态码范围：10000-20000
 * All Rights Reserved.
 * @version 1.0  2016年7月4日 下午2:49:10  by 代鹏（daipeng.456@gmail.com）创建
 */
public enum BusinessErrorCodeEnum {

    ACTIVITY_ERR_500("-500", "系统异常请稍后重试"),
    ACTIVITY_ERR_10000("10000", "参数非法"),
    ACTIVITY_ERR_10001("10001", "活动不存在"),
	BASE_INFO_ERR_CODE_1204000("-1204000", "获取功能图标列表失败"),
	BASE_INFO_ERR_CODE_1204001("-1204001", "更新功能图标失败"),
	BASE_INFO_ERR_CODE_1204002("-1204002", "新增功能图标失败"),
	BASE_INFO_ERR_CODE_1204003("-1204003", "更新功能图标分类信息失败"),
	BASE_INFO_ERR_CODE_1204004("-1204004", "获取功能图标分类信息失败"),
	BASE_INFO_ERR_CODE_1204005("1204005", "图标id不能为空"),
	BASE_INFO_ERR_CODE_1204006("1204006", "图标url不能为空"),
	BASE_INFO_ERR_CODE_1204007("1204007", "功能图标分类id不能为空"),
	;

	private String code;
	private String msg;

	private BusinessErrorCodeEnum(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public static BusinessErrorCodeEnum getByErrorCode(int code){
		for(BusinessErrorCodeEnum errorCodeEnum : BusinessErrorCodeEnum.values()){
			if(errorCodeEnum.getCode().equals(code)){
				return errorCodeEnum;
			}
		}
		return null;
	}

}
